修订号 1
https.createServer(options, [requestListener])
返回一个新的 HTTPS Web 服务器对象。其中 options
类似于 [tls.createServer()][];requestListener
是一个会被自动添加到 request
事件的函数。
示例:
https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);
或者
https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);